﻿
@{
    ViewBag.Title = "加密解密";
}


<div class="row">
    <div class="navbar-form navbar-left" role="search">
        <div class="form-group">
            <input id="msg" type="text" class="form-control" placeholder="加密解密" />
        </div>
        <div class="btn-group" data-toggle="buttons" id="action">
            <label class="btn btn-primary">
                <input type="radio" name="enc" value="e" autocomplete="off" />
                加密
            </label>
            <label class="btn btn-primary active">
                <input type="radio" name="enc" checked="checked" value="d" autocomplete="off" />
                解密
            </label>
        </div>
        <button type="button" id="btnOK" class="btn btn-default">提交</button>
        <input id="txtResult" type="text" class="form-control" readonly="readonly" />
    </div>
</div>

@section scripts{
    <script>
        $(function () {
            $('#btnOK').click(function () {
                var msg = $('#msg').val();
                if (msg == '') {
                    alert('请输入内容');
                    return;
                }
                var type = $('#action input:radio:checked').val();
                $.post('/Enc/Index', {s:msg,t:type}, function (data) {
                    $('#txtResult').val(data);
                });
            });
        });
    </script>
}
